package me.leiusual.sharing.ui.order.adapter

import android.view.View
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.extensions.LayoutContainer
import kotlinx.android.synthetic.main.view_holder_order_list_child.*
import me.leiusual.sharing.api.model.orderdetail.OrderDetailX
import me.leiusual.sharing.util.extension.setImageUrl

/**
 * author: leiusual
 * create on: 2019-08-03
 * description:
 */
class OrderDetailViewHolder(
    override val containerView: View
) : RecyclerView.ViewHolder(containerView), LayoutContainer {

  fun bind(orderDetail: OrderDetailX) {
    image_view.setImageUrl(orderDetail.productImage)
    text_view_product_name.text = orderDetail.productName
    text_view_model_desc.text = orderDetail.modelDesc
    text_view_quantity.text = "x${orderDetail.quantity}"
  }
}